package com.hancher.gamelife2.account;

import android.view.LayoutInflater;
import android.view.ViewGroup;

import com.hancher.common.javautil.EmptyUtil;
import com.hancher.common.rv.BaseVBAdapter;
import com.hancher.gamelife2.databinding.ItemAccountBinding;

/**
 * 作者 : Hancher ytu_shaoweijie@163.com <br/>
 * 时间 : 2023/5/21 17:37 <br/>
 * 描述 :
 */
public class AccountAdapter extends BaseVBAdapter<ItemAccountBinding, AccountPO> {

    @Override
    protected ItemAccountBinding createViewBinding(LayoutInflater from, ViewGroup viewGroup) {
        return ItemAccountBinding.inflate(from, viewGroup, false);
    }

    @Override
    protected void convertItem(ItemAccountBinding binding, int position, AccountPO item) {
        binding.itemAccount.setText(item.getAccount());
        binding.itemUser.setText(item.getUser());
        binding.itemIcon.setText(EmptyUtil.isEmpty(item.getAccount()) ? "@" : item.getAccount());
    }

}
